﻿using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using Newtonsoft.Json;
using System;

namespace AppSocketModel
{
    /// <summary>
    /// 账户模型
    /// </summary>
    [BsonIgnoreExtraElements]
    public class AccountDto
    {
        /// <summary>
        /// Id
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        [BsonRepresentation(BsonType.ObjectId)]
        public string Id { get; set; }

        /// <summary>
        /// 账户Id
        /// </summary>
        public string AccountId
        {
            get
            {
                return Id;
            }
        }

        /// <summary>
        /// 公司Id
        /// </summary>
        public int CompanyId { set; get; }


        /// <summary>
        /// 父Id
        /// </summary>
        public string ParentAccountId { set; get; }
        
        
        /// <summary>
        /// 账户号
        /// </summary>
        /// <returns></returns>
        public string AccountCode { set; get; }


        /// <summary>
        /// 账户角色
        /// </summary>
        public AccountRole AccountRole { set; get; }

        /// <summary>
        /// 账户角色描述
        /// </summary>
        public string AccountRoleStr
        {
            get
            {
                return AccountRole.GetDescriptionString();
            }
        }

        /// <summary>
        /// 账户类型
        /// </summary>
        public AccountCodeType AccountCodeType { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public string AccountCodeTypeStr
        {
            get
            {
                return AccountCodeType.GetDescriptionString();
            }
        }

        /// <summary>
        /// 账号名
        /// </summary>
        public string AccountName { set; get; }

        /// <summary>
        /// 密码
        /// </summary>
        public string Password { set; get; }

        /// <summary>
        /// 创建时间
        /// </summary>  
        public DateTime CreateTime { set; get; }

        /// <summary>
        /// 修改时间
        /// </summary> 
        public DateTime UpdateTime { set; get; }

        /// <summary>
        /// 最后登录时间
        /// </summary>
        public DateTime LastLoginTime { set; get; }

        /// <summary>
        /// 登录次数
        /// </summary>
        public long LoginTimes { set; get; }

        /// <summary>
        /// 登录IP
        /// </summary>
        public string LoginIp { set; get; }

        /// <summary>
        /// 车辆数
        /// </summary>
        public int VehicleCount { set; get; }

        /// <summary>
        /// 车辆总数
        /// </summary>
        public int VehicleTotal { set; get; }

        /// <summary>
        /// 子账户数
        /// </summary>
        public int SubAccountCount { set; get; }

        /// <summary>
        /// 手机号
        /// </summary>
        public string Phone { set; get; }

        /// <summary>
        /// 验证码
        /// </summary>
        public string VerifyCode { set; get; }

        /// <summary>
        /// 验证码有效时间
        /// </summary>
        public DateTime VerifyCodeValidTime { set; get; }

         
    }
}
